package eu.fishcode.android.ui;

import java.io.File;

import javax.swing.JFileChooser;
import javax.swing.filechooser.FileFilter;

import eu.fishcode.android.utils.Utils;



public class OpenAndSaveDialog extends JFileChooser {

	public OpenAndSaveDialog() {
		super();
		setCurrentDirectory(new File(Utils.UserHome));
		setFileSelectionMode(JFileChooser.FILES_ONLY);
		addChoosableFileFilter(new AbaFileFilter());
		setFileFilter(getChoosableFileFilters()[1]);
	}
	
	public class AbaFileFilter extends FileFilter {

		@Override
		public boolean accept(File file) {
			if (file.isDirectory()) {
				return true;
			}
			return file.getName().toLowerCase().endsWith(".zip");
		}

		@Override
		public String getDescription() {
			return "Android Boot Animation ZIP (*.zip)";
		}
	}

}
